package com.glwan.fixedassetapp.model;

import com.glwan.fixedassetapp.utils.CommonUtil;

public class RFIDTagData {

    String epc;

    String tid;

    String user;

    String reserved;

    short antennaID;

    int rssi;

    short relativeDistance;


    public String getEpc() {
        if (epc == null || epc.isEmpty())
            return "";
        if(epc.startsWith("E")){
            return "";
        }
        epc=epc.replaceAll("00$","");
        return CommonUtil.hexToString(epc);
    }

    public void setEpc(String epc) {
        this.epc = epc;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getReserved() {
        return reserved;
    }

    public void setReserved(String reserved) {
        this.reserved = reserved;
    }

    public short getAntennaID() {
        return antennaID;
    }

    public void setAntennaID(short antennaID) {
        this.antennaID = antennaID;
    }

    public int getRssi() {
        return rssi;
    }

    public void setRssi(int rssi) {
        this.rssi = rssi;
    }

    public short getRelativeDistance() {
        return relativeDistance;
    }

    public void setRelativeDistance(short relativeDistance) {
        this.relativeDistance = relativeDistance;
    }

    @Override
    public String toString() {
        return "RFIDTagData{" +
                "epc='" + epc + '\'' +
                ", tid='" + tid + '\'' +
                ", user='" + user + '\'' +
                ", reserved='" + reserved + '\'' +
                ", antennaID=" + antennaID +
                ", rssi=" + rssi +
                ", relativeDistance=" + relativeDistance +
                '}';
    }
}
